﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TimViec.NguoiDung
{
    public partial class ViewAccount : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadData();
            }
        }

        private void LoadData()
        {
            if (Session["NguoiDung"] != null)
            {
                DAL.User user = BLL.NguoiDung.NguoiDung.Get_UserEmail(Session["NguoiDung"].ToString());

                imgAvatar.ImageUrl = user.UrlAvatar;
                Name.Text = user.UserName;
                lbSex.Text = user.Sex ? "Nam" : "Nữ";
                lbbirthday.Text = user.Birth.ToString("dd/MM/yyyy");
                lbttHonNhan.Text = user.RelationShip;
                lbDiaChi.Text = user.DiaChi;
                lbEmail.Text = user.Email;
                lbDienThoai.Text = user.DienThoai;
                lbDiDong.Text = user.DiDong;
                lbNgayDK.Text = user.NgayDangKy.ToString("dd/MM/yyyy");
            }
            else
            {
               Response.Redirect("/");
            }
        }
    }
}